Public Class DpapiEncryptionForm

  Dim encryption As New dotNetTips.Utility.Encryption.Dpapi


  Private Sub EncryptButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EncryptButton.Click

    If InputTextBox.Text.Length > 0 Then
      InputTextBox.Text = encryption.Encrypt(InputTextBox.Text)
    End If

  End Sub

  Private Sub DecryptButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DecryptButton.Click

    If InputTextBox.Text.Length > 0 Then
      InputTextBox.Text = encryption.Decrypt(InputTextBox.Text)
    End If

  End Sub
End Class